-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backend: add error variant for access denied, handle when diffing #3785
Conversation
9741dcc
to
ae4f5f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some backends, like the one we have at Google, can restrict access to
certain files. For such files, if they return a regular
BackendError::ReadObject
, then that will terminate iteration in many
cases (e.g. when diffing or listing files). This patch adds a new
error variant for them to return instead, plus handling of such errors
in diff output.
Happy to see this feature, as better ACLs is something I really want for the native backend.
ae4f5f2
to
e4d9e24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG after addressing Yuya's nits.
e4d9e24
to
a6aa6a6
Compare
I'm going to add a similar message for access denied. That will want an error message printed at the end. For consistency, let's do the same for non-file paths.
1480d70
to
ff79a02
Compare
Some backends, like the one we have at Google, can restrict access to certain files. For such files, if they return a regular `BackendError::ReadObject`, then that will terminate iteration in many cases (e.g. when diffing or listing files). This patch adds a new error variant for them to return instead, plus handling of such errors in diff output and in the working copy. In order to test the feature, I added a new commit backend that returns the new `ReadAccessDenied` error when the caller tries to read certain objects.
ff79a02
to
20816cf
Compare
Checklist
If applicable:
CHANGELOG.md